<div id="content">
  <div class="row s_page_title">
    <div class="row s_page_title">
      <sa-big-breadcrumbs
        [items]="['项目实施团队', '安装故障率统计']"
        icon="fa fa-wrench"
        class="col-xs-12 col-sm-7 col-md-7 col-lg-4"
      ></sa-big-breadcrumbs>
    </div>
    <sa-widgets-grid>
      <div class="s_table">
        <div sa-widget [editbutton]="false" color="darken" class="clearfix">
          <header>
            <span class="widget-icon"><i class="fa fa-table"></i></span>
            <h2>安装故障率统计</h2>
          </header>
          <div>
            <div class="widget-body no-padding">
              <div class="page-header clearfix s_table_opreation">
                <div class="left page-header-btn" style="width: calc(100% - 230px)">
                  <div class="top_module">
                    <span class="module_text">所属公司</span>
                    <sa-company-tree
                      companyTreeId="companyTree"
                      (companySelected)="companySelected($event)"
                    ></sa-company-tree>
                  </div>
                  <div class="top_module">
                    <span class="top_module_label module_text">用户类型</span>
                    <select name="" class="top_module_select" [(ngModel)]="userType" (change)="statistics()">
                      <option value="">全部</option>
                      <option *ngFor="let item of userTypeList" [value]="item.id">{{ item.text }}</option>
                    </select>
                  </div>
                  <div class="selectDate top_module">
                    <table-select-date (outerTime)="getSelectTableTime($event)"></table-select-date>
                  </div>
                  <!-- <button class="btn btn-primary" (click)="tableSearch()">查询</button> -->
                  <button type="button" class="btn btn-primary" (click)="statistics()">统计</button>
                  <button type="button" class="btn btn-primary" (click)="exportData()">导出</button>
                </div>
                <!-- <div class="right top-search">
									<input type="text" [(ngModel)]="tableParam.searchKey" (change)="tableSearch()" class="search-input"
										placeholder="公司名称">
									<span class="top-search-box">
										<button class="top-search-btn" type="button" (click)="tableSearch()"> <i
												class="fa fa-search"></i></button>
									</span>
								</div> -->
              </div>
              <div class="table_scroll" style="height: 620px">
                <table
                  class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table"
                >
                  <thead>
                    <tr>
                      <th>用户类型</th>
                      <th>项目名称</th>
                      <th>厂区名称</th>
                      <th>省份</th>
                      <th>安装人员</th>
                      <th>
                        <span>车辆安装总数</span>
                        <span class="sort-icon">
                          <i
                            class="fa fa-caret-left"
                            [ngClass]="{ active: columnSortFlag == '1-1' }"
                            (click)="columnSort('1-1')"
                          ></i>
                          <i
                            class="fa fa-caret-right"
                            [ngClass]="{ active: columnSortFlag == '1-2' }"
                            (click)="columnSort('1-2')"
                          ></i>
                        </span>
                      </th>
                      <th>
                        <span>传感器安装总数</span>
                        <span class="sort-icon">
                          <i
                            class="fa fa-caret-left"
                            [ngClass]="{ active: columnSortFlag == '2-1' }"
                            (click)="columnSort('2-1')"
                          ></i>
                          <i
                            class="fa fa-caret-right"
                            [ngClass]="{ active: columnSortFlag == '2-2' }"
                            (click)="columnSort('2-2')"
                          ></i>
                        </span>
                      </th>
                      <th>
                        <span>已维修传感器车次</span>
                        <span class="sort-icon">
                          <i
                            class="fa fa-caret-left"
                            [ngClass]="{ active: columnSortFlag == '3-1' }"
                            (click)="columnSort('3-1')"
                          ></i>
                          <i
                            class="fa fa-caret-right"
                            [ngClass]="{ active: columnSortFlag == '3-2' }"
                            (click)="columnSort('3-2')"
                          ></i>
                        </span>
                      </th>
                      <th>
                        <span>已维修传感器个数</span>
                        <span class="sort-icon">
                          <i
                            class="fa fa-caret-left"
                            [ngClass]="{ active: columnSortFlag == '4-1' }"
                            (click)="columnSort('4-1')"
                          ></i>
                          <i
                            class="fa fa-caret-right"
                            [ngClass]="{ active: columnSortFlag == '4-2' }"
                            (click)="columnSort('4-2')"
                          ></i>
                        </span>
                      </th>
                      <th>
                        <span>待维修传感器车次</span>
                        <span class="sort-icon">
                          <i
                            class="fa fa-caret-left"
                            [ngClass]="{ active: columnSortFlag == '5-1' }"
                            (click)="columnSort('5-1')"
                          ></i>
                          <i
                            class="fa fa-caret-right"
                            [ngClass]="{ active: columnSortFlag == '5-2' }"
                            (click)="columnSort('5-2')"
                          ></i>
                        </span>
                      </th>
                      <th>
                        <span>待维修传感器个数</span>
                        <span class="sort-icon">
                          <i
                            class="fa fa-caret-left"
                            [ngClass]="{ active: columnSortFlag == '6-1' }"
                            (click)="columnSort('6-1')"
                          ></i>
                          <i
                            class="fa fa-caret-right"
                            [ngClass]="{ active: columnSortFlag == '6-2' }"
                            (click)="columnSort('6-2')"
                          ></i>
                        </span>
                      </th>
                      <th>
                        <span>待维修GPS</span>
                        <span class="sort-icon">
                          <i
                            class="fa fa-caret-left"
                            [ngClass]="{ active: columnSortFlag == '7-1' }"
                            (click)="columnSort('7-1')"
                          ></i>
                          <i
                            class="fa fa-caret-right"
                            [ngClass]="{ active: columnSortFlag == '7-2' }"
                            (click)="columnSort('7-2')"
                          ></i>
                        </span>
                      </th>
                      <th>
                        <span>标记传感器车次</span>
                        <span class="sort-icon">
                          <i
                            class="fa fa-caret-left"
                            [ngClass]="{ active: columnSortFlag == '8-1' }"
                            (click)="columnSort('8-1')"
                          ></i>
                          <i
                            class="fa fa-caret-right"
                            [ngClass]="{ active: columnSortFlag == '8-2' }"
                            (click)="columnSort('8-2')"
                          ></i>
                        </span>
                      </th>
                      <th>
                        <span>标记传感器个数</span>
                        <span class="sort-icon">
                          <i
                            class="fa fa-caret-left"
                            [ngClass]="{ active: columnSortFlag == '9-1' }"
                            (click)="columnSort('9-1')"
                          ></i>
                          <i
                            class="fa fa-caret-right"
                            [ngClass]="{ active: columnSortFlag == '9-2' }"
                            (click)="columnSort('9-2')"
                          ></i>
                        </span>
                      </th>
                      <th>
                        <span>标记GPS</span>
                        <span class="sort-icon">
                          <i
                            class="fa fa-caret-left"
                            [ngClass]="{ active: columnSortFlag == '10-1' }"
                            (click)="columnSort('10-1')"
                          ></i>
                          <i
                            class="fa fa-caret-right"
                            [ngClass]="{ active: columnSortFlag == '10-2' }"
                            (click)="columnSort('10-2')"
                          ></i>
                        </span>
                      </th>
                      <th>
                        <span>已维修传感器车次占比</span>
                        <span class="sort-icon">
                          <i
                            class="fa fa-caret-left"
                            [ngClass]="{ active: columnSortFlag == '11-1' }"
                            (click)="columnSort('11-1')"
                          ></i>
                          <i
                            class="fa fa-caret-right"
                            [ngClass]="{ active: columnSortFlag == '11-2' }"
                            (click)="columnSort('11-2')"
                          ></i>
                        </span>
                      </th>
                      <th>
                        <span>已维修传感器个数占比</span>
                        <span class="sort-icon">
                          <i
                            class="fa fa-caret-left"
                            [ngClass]="{ active: columnSortFlag == '12-1' }"
                            (click)="columnSort('12-1')"
                          ></i>
                          <i
                            class="fa fa-caret-right"
                            [ngClass]="{ active: columnSortFlag == '12-2' }"
                            (click)="columnSort('12-2')"
                          ></i>
                        </span>
                      </th>
                      <th>
                        <span>待维修传感器车次占比</span>
                        <span class="sort-icon">
                          <i
                            class="fa fa-caret-left"
                            [ngClass]="{ active: columnSortFlag == '13-1' }"
                            (click)="columnSort('13-1')"
                          ></i>
                          <i
                            class="fa fa-caret-right"
                            [ngClass]="{ active: columnSortFlag == '13-2' }"
                            (click)="columnSort('13-2')"
                          ></i>
                        </span>
                      </th>
                      <th>
                        <span>待维修传感器个数占比</span>
                        <span class="sort-icon">
                          <i
                            class="fa fa-caret-left"
                            [ngClass]="{ active: columnSortFlag == '14-1' }"
                            (click)="columnSort('14-1')"
                          ></i>
                          <i
                            class="fa fa-caret-right"
                            [ngClass]="{ active: columnSortFlag == '14-2' }"
                            (click)="columnSort('14-2')"
                          ></i>
                        </span>
                      </th>
                      <th>
                        <span>待维修GPS占比</span>
                        <span class="sort-icon">
                          <i
                            class="fa fa-caret-left"
                            [ngClass]="{ active: columnSortFlag == '15-1' }"
                            (click)="columnSort('15-1')"
                          ></i>
                          <i
                            class="fa fa-caret-right"
                            [ngClass]="{ active: columnSortFlag == '15-2' }"
                            (click)="columnSort('15-2')"
                          ></i>
                        </span>
                      </th>
                      <th>
                        <span>标记传感器车次占比</span>
                        <span class="sort-icon">
                          <i
                            class="fa fa-caret-left"
                            [ngClass]="{ active: columnSortFlag == '16-1' }"
                            (click)="columnSort('16-1')"
                          ></i>
                          <i
                            class="fa fa-caret-right"
                            [ngClass]="{ active: columnSortFlag == '16-2' }"
                            (click)="columnSort('16-2')"
                          ></i>
                        </span>
                      </th>
                      <th>
                        <span>标记传感器个数占比</span>
                        <span class="sort-icon">
                          <i
                            class="fa fa-caret-left"
                            [ngClass]="{ active: columnSortFlag == '17-1' }"
                            (click)="columnSort('17-1')"
                          ></i>
                          <i
                            class="fa fa-caret-right"
                            [ngClass]="{ active: columnSortFlag == '17-2' }"
                            (click)="columnSort('17-2')"
                          ></i>
                        </span>
                      </th>
                      <th>
                        <span>标记GPS占比</span>
                        <span class="sort-icon">
                          <i
                            class="fa fa-caret-left"
                            [ngClass]="{ active: columnSortFlag == '18-1' }"
                            (click)="columnSort('18-1')"
                          ></i>
                          <i
                            class="fa fa-caret-right"
                            [ngClass]="{ active: columnSortFlag == '18-2' }"
                            (click)="columnSort('18-2')"
                          ></i>
                        </span>
                      </th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr *ngFor="let row of tableData">
                      <td>{{ row.userTypeName }}</td>
                      <td>{{ row.projectName }}</td>
                      <td>{{ row.companyName }}</td>
                      <td>{{ row.provinceName }}</td>
                      <td>{{ row.userName }}</td>
                      <td>{{ row.installedTotal }}</td>
                      <td>{{ row.sensorTotal }}</td>
                      <td>{{ row.sensorRepaired }}</td>
                      <td>{{ row.sensorRepairedCount }}</td>
                      <td>{{ row.sensorRepair }}</td>
                      <td>{{ row.sensorRepairCount }}</td>
                      <td>{{ row.gpsRepairCount }}</td>
                      <td>{{ row.sensorFlag }}</td>
                      <td>{{ row.sensorFlagCount }}</td>
                      <td>{{ row.gpsFlag }}</td>
                      <td>{{ row.sensorRepairedPct }}</td>
                      <td>{{ row.sensorRepairedCountPct }}</td>
                      <td>{{ row.sensorRepairPct }}</td>
                      <td>{{ row.sensorRepairCountPct }}</td>
                      <td>{{ row.gpsRepairCountPct }}</td>
                      <td>{{ row.sensorFlagPct }}</td>
                      <td>{{ row.sensorFlagCountPct }}</td>
                      <td>{{ row.gpsFlagPct }}</td>
                    </tr>
                  </tbody>
                </table>
              </div>
              <div style="height: 60px; line-height: 60px; text-align: center; color: #ccc">
                <span *ngIf="tableData.length > 0">共{{ tableData.length }}条数据</span>
                <span *ngIf="tableData.length == 0">暂无数据</span>
              </div>
              <!-- <div class="table-fix clearfix">
								<paginator [totalRecords]="totalCount" [rows]="pageSize" [currentPage]="curPage - 1"
									(onPageChange)="paginate($event)">
								</paginator>
								<button type="button" class="btn default refresh_btn" (click)="refresh()"><i
										class="fa fa-refresh"></i></button>
							</div> -->
            </div>
          </div>
        </div>
      </div>
    </sa-widgets-grid>
  </div>
</div>
